<?php
header("content-type:text/html;charset=utf-8");
$sername="localhost";
$user="root";
$password="123123";
$dbname="xbs_bbs";
try{
    $conn=new PDO("mysql:host=$sername;dbname=$dbname;charset=utf8",$user,$password);

    $sql="select * from stus";
    $b=$conn->prepare($sql);
    $res=$b->execute();
    if($res){
        while($row=$b->fetch(PDO::FETCH_ASSOC)){
            print_r($row);
            echo "<hr/>";
        }
    }
}catch (PDOException $e){
    echo $e->getMessage();

}
